// 1. 引入 axios
import axios from "../myaxios/myaxios1";
/* 获取所有用户的总数 */
export const getTotalUser = () => {
  return axios.get("/v1/users/count");
};
/* 获取注册用户 */
// /statis/user/:date/count
export const getUserCount = (dateString) => {
  return axios.get("/statis/user/" + dateString + "/count");
};

/* 获取所有的订单 */
// /bos/orders/count
export const getTotalOrders = () => axios.get("/bos/orders/count");

/* 获取当天新增的订单 */
// /statis/order/:date/count
export const getOrderCount = (dateString) =>
  axios.get("/statis/order/" + dateString + "/count");
/* 获取所有管理员 */
// /admin/count
export const getTotalAdmins = () => axios.get("/admin/count");
// 获取当天新增的管理员
export const getAdminCount = (dateString) =>
  axios.get("/statis/admin/" + dateString + "/count");
// 获取用户列表
export const getUserList = (params) =>
  axios.get("/v1/users/list", {
    params: params,
  });
/* 获取管理员列表 */
export const getAdminList = (params) =>
  axios.get("/admin/all", {
    params: params,
  });
/* 获取订单列表 */
export const getOrderList = (params) =>
  axios.get("/bos/orders", {
    params: params,
  });
/* 获取食品列表 */
export const getTagList = (params) =>
  axios.get("/shopping/v2/foods", {
    params: {
      ...params,
      restaurant_id: 0,
    },
  });
/* 获取食品数量 */
export const getTotalFoodCount = () => axios.get("/shopping/v2/foods/count");

export const updateFood = (data) => axios.post("/shopping/v2/updatefood", data);
/**
 * 获取餐馆详细信息
 */

// export const getResturantDetail = (restaurant_id) =>
//   axios.get("/shopping/restaurant/" + restaurant_id);

//   /**
//  * 获取menu详情
//  */

// export const getMenuById = (category_id) =>
// axios.get("/shopping/v2/menu/" + category_id);

// /* 获取食品列表 */
// export const getMenu = (data) =>
//   axios.get("/shopping/v2/menu", {
//     params: data,
//   });